#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# author: maxiao
# date: 2023-03-05 10:45
# descritpion: 测试isinstance和type的区别


class A:
    pass


class B(A):
    pass


# 实例化对象
b = B()
# isinstance()用于判断一个对象是否为一个已知的类型（考虑继承关系）
print('isinstance(b, B): ', isinstance(b, B))
print('isinstance(b, A): ', isinstance(b, A))
# type()则返回对象的类弄（不考虑继承关系）
print('type(b) is B: ', type(b) is B)
print('type(b) is A: ', type(b) is A)
